<template>
    <div class="todo-container">
        <div class="todo-wrap">
            <TodoHeader/>
            <TodoList/>
            <TodoFooter/>
        </div>
    </div>
</template>

<script>
    import TodoHeader from './componets/TodoHeader'
    import TodoList from './componets/TodoList'
    import TodoFooter from './componets/TodoFooter'

    export default {
        mounted(){
          //发送命令给action:异步获取数据(模拟请求后台api)展示
         this.$store.dispatch('requestTodos')
        },
        components: {
            TodoHeader,
            TodoList,
            TodoFooter
        }
    }
</script>

<style>
    .todo-container {
        width: 600px;
        margin: 0 auto;
    }
    .todo-container .todo-wrap {
        padding: 10px;
        border: 1px solid #ddd;
        border-radius: 5px;
    }
</style>